<?php
$this->breadcrumbs=array(
	$model->name=>array('view','id'=>$model->id),
	Yii::t('project','Update Project'),
);
?>


<script type="text/javascript">
	function initialize() {
	 	// 百度地图API功能
	    var map = new BMap.Map("baiduMap");
	    map.centerAndZoom(new BMap.Point(101.75533059715, 29.957989349167), 8);
	    map.addControl(new BMap.NavigationControl());  //添加默认缩放平移控件
	    function showInfo(e){
	    	document.getElementById("Project_longitude").value = e.point.lng;
	    	document.getElementById("Project_latitude").value = e.point.lat;
	     	alert("<?php echo Yii::t('project','Location Information been changed');?>");
	    }
	    map.addEventListener("click", showInfo);
	}
	 
	function loadScript() {
	  var script = document.createElement("script");
	  script.src = "http://api.map.baidu.com/api?v=2.0&ak=5a90faa9eadcf6b86a4165ea8f218b47&callback=initialize";//此为v2.0版本的引用方式
	  // http://api.map.baidu.com/api?v=1.5&ak=您的密钥&callback=initialize"; //此为v1.4版本及以前版本的引用方式
	  document.body.appendChild(script);
	}
	 
	window.onload = loadScript;
</script>

<h1>
	<?php echo Yii::t('project','Update Project');?>
</h1>

<div class="row-fluid">
	<div class="span6">
		<?php echo $this->renderPartial('_form',array('model'=>$model)); ?>
	</div>
	<div class="span6">
		<div class="row-fluid">
			<div class="span12">
				<div id="baiduMap" style="width: 100%;min-height: 415px;overflow: hidden;margin:0;"></div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="span12">
				<div id="projectTips" class="alert alert-info" style="text-align:center">
					<?php echo Yii::t('project','Drag and Drop map to find the project location and click on it to fill in location information');?>
				</div>
			</div>
		</div>
	</div>
</div>